/*
 Copyright (C) 2009 QDSS.org
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.qdss.persist;

import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Iterator;

import org.qdss.persist.engine.entry.ID;


/**
 * 
 * 
 * @author <a href="mailto:zhaofang123@gmail.com">FANGFANG ZHAO</a>
 * @since 0.1.0, Jan 22, 2009
 * @version $Id: Record.java 51 2009-05-06 07:45:48Z zhaofang123@gmail.com $
 */
public interface Record extends Cloneable {

	Entity getEntity();

	ID getEditor();

	ID getPrimary();

	Record setID(String key, ID value);

	ID getID(String key);

	Record setIDArray(String key, ID[] values);

	ID[] getIDArray(String key);

	Record setChar(String key, Character value);

	Character getChar(String key);

	Record setString(String key, String value);

	String getString(String key);

	Record setInt(String key, Integer value);

	Integer getInt(String key);

	Record setDouble(String key, Double value);

	Double getDouble(String key);

	Record setDecimal(String key, BigDecimal value);

	BigDecimal getDecimal(String key);

	Record setDate(String key, Date value);

	Date getDate(String key);

	Record setBoolean(String key, Boolean value);

	Boolean getBoolean(String key);

	Record setBinary(String key, InputStream stream);

	InputStream getBinary(String key);

	Record setReader(String key, Reader value);

	Record setReader(String key, String value);

	Reader getReader(String key);

	Record setObjectValue(String key, Object value);

	Object getObjectValue(String key);

	boolean hasValue(String key);
	
	Object removeValue(String key);
	
	Object setNull(String key);

	Iterator<String> getAvailableFieldIterator();

	Record clone();
}
